module.exports = {
  apps: [{
    name: 'oracle-sql-lib',
    script: '.',
    // Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
    args: '',
    instances: 1, // 生产环境上大于 1
    // 会报 Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so"
    autorestart: true,
    kill_timeout: 60 * 1000, // 从发出停止 SIGINT 信号到强制停止等待的时间，给一分钟在途请求处理时间
    // wait_ready: true,
    watch: false,
    max_memory_restart: '1G',
    merge_logs: true,
    env: {
      NODE_ENV: 'development',
      PORT: 3014,
      UV_THREADPOOL_SIZE: 40, // 连接池数量增加，本数值需要影响增加
      // https://oracle.github.io/node-oracledb/doc/api.html#numberofthread
      NLS_LANG: 'American_America.UTF8',
      NLS_DATE_FORMAT: 'yyyy-mm-dd hh24:mi:ss',
      // LD_LIBRARY_PATH: '/home/wosale/opt/instantclient_12_1-linux86',
    },
    env_test: {
      NODE_ENV: 'development',
      ENV: 'test',
    },
    env_prod: {
      NODE_ENV: 'production',
      ENV: 'prod',
    },
  }],
};
